home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Common / nocrt.cpp < prev    next >
Text File  |  1997-01-03  |  805b  |  51 lines

  1. //
  2. //  NOCRT.CPP
  3. //
  4. //  Copyright (C) Microsoft Corporation, 1996
  5. //
  6. //  Replacement C runtime routines to avoid pulling in any unnecessary goo.
  7. //
  8.  
  9. #include "config.h"
  10.  
  11. #define FAR
  12.  
  13. #include <ole2.h>
  14. #include <dispatch.h>
  15. #include <wintypes.h>
  16. #include "debug.h"
  17. #include "nocrt.h"
  18.  
  19. #define __cdecl
  20.  
  21. LPOLESTR OleStrdup(LPCOLESTR psz)
  22. {
  23.     LPOLESTR pszDup;
  24.  
  25.     if ((pszDup = (LPOLESTR) CoTaskMemAlloc(strlen((char *) psz) + 1)) != NULL)
  26.         strcpy((char *) pszDup, (const char *) psz);
  27.  
  28.     return pszDup;
  29. }
  30.  
  31. #ifdef ACTIVEX_CONTROL
  32. void * __cdecl operator new(size_t nSize)
  33. {
  34.     return CoTaskMemAlloc(nSize);
  35. }
  36.  
  37. void __cdecl operator delete(void *pv)
  38. {
  39.     CoTaskMemFree(pv);
  40. }
  41.  
  42. int __cdecl _purecall(void);
  43. int __cdecl _purecall(void)
  44. {
  45. #ifdef _DEBUG
  46.     Debugger();
  47. #endif
  48.     return 0;
  49. }
  50. #endif
  51.